home *** CD-ROM | disk | FTP | other *** search
/ Know Your Hockey - The Greatest Player Resource / Know Your Hockey: The Greatest Player Resource.iso / hockey / director / ssqcst.cst / 00032_Script_VideoControlBar < prev    next >
Text File  |  1998-09-28  |  4KB  |  132 lines

  1. global gClipOut,gControls,gOpning 
  2.  
  3. on puckControl
  4.   losepop(window "pop")
  5.   if the type of sprite 48 = 0 then exit
  6.   set status = the movierate of sprite 48
  7.   set the movierate of sprite 48 = 0
  8.   put the rect of sprite 2 into limitRect
  9.   put the left of limitrect+34 into leftlimit
  10.   put the right of  limitrect -14 into rightlimit  
  11.   repeat while the mousedown
  12.     put the mouseh into hPos
  13.     put max(leftLimit,hPos) into hPos
  14.     put min(rightLimit,hPos) into hPos
  15.     set the loch of sprite 4= hPos
  16.     set frame = (((hpos-leftlimit)*100/( rightlimit -leftlimit ))*gclipout)/100
  17.     set the movietime of sprite 48 = frame  
  18.     updatestage
  19.   end repeat
  20.   set  the movierate of sprite 48 = status
  21. end
  22.  
  23.  
  24. --- positions the puck relative to the movietime  
  25. --- used by videoplayer and stopstart
  26. --- divides the movie duration and the distance to be moved into 10 units
  27.  
  28. on puckposition
  29.   set l = the left of sprite 2+34
  30.   set d = the width of sprite 2-34
  31.   set a = d/10
  32.   set p =float( the movietime of sprite 48)/float(gClipOut)
  33.   set m =integer((p+.03)*10 )
  34.   set m =min(10,m)
  35.   if the loch of sprite 4 <> l+(a*m) then  set the loch of sprite 4 =l+(a*m)
  36. end
  37.  
  38. --on pointermove
  39. --  set percent = ((the loch of sprite 7-(the left of sprite 6+40)))*gClipOut/195
  40. --  set the movietime of sprite 48  = percent
  41. --end
  42.  
  43. on StopStart
  44.   sound stop 2
  45.   puppetsound 0
  46.   updatestage
  47.   --- for BTG where stop start has to change banner icons
  48.   set t = char 1 of the moviename
  49.   if t = "b" then  
  50.     puppetsound 0
  51.     resetbanner
  52.   end if
  53.   if  the type of sprite 48 = 0 then exit
  54.   if the movierate of sprite 48 = 0 then 
  55.     -- rewind if you are basically at the end
  56.     if the movietime of sprite 48 >=gclipout-30 then set the movietime of sprite 48 = 0
  57.     setvideovolume
  58.     set the movierate of sprite 48 =1
  59.     set the membernum of sprite 3 = member "StopStart" of castlib "SSQCST"
  60.     set the blend of sprite 3 to 100
  61.     
  62.     set t = the number of member "puck" of castlib "SSQCST"
  63.   else
  64.     puckposition
  65.     set t = the number of member "puck" of castlib "SSQCST"
  66.     set the scriptText of member t = the scriptText of member "PuckScript"of castlib "SSQCST"   
  67.     set the movierate of sprite 48 =0
  68.     set the membernum of sprite 3 = member "play" of castlib "SSQCST"
  69.     set the blend of sprite 3 to 100
  70.   end if
  71.   updatestage
  72. end
  73.  
  74. -- for help button in BTG
  75. on Stoponly
  76.   if  the membernum of sprite 48 = 0 then   exit
  77.   puckposition
  78.   set t = the number of member "puck" of castlib "SSQCST"
  79.   set the scriptText of member t = the scriptText of member "PuckScript"of castlib "SSQCST"   
  80.   set the movierate of sprite 48 =0
  81.   set the membernum of sprite 3 = member "play" of castlib "SSQCST"
  82.   set the blend of sprite 3 to 100
  83.   updatestage
  84. end
  85.  
  86.  
  87. on resetVideo
  88.   set the movierate of sprite 48 = 0
  89.   set the movietime of sprite 48 = gclipout
  90.   updatestage
  91.   set the membernum of sprite 3 = member "play" of castlib "SSQCST"
  92. end
  93.  
  94.  
  95.  
  96.  
  97.  
  98. ---------------------------Turn the control bar off and on ------------------------
  99.  
  100. on ControlOn
  101.   puckposition
  102.   repeat with x = 2 to 5
  103.     puppetsprite x,1
  104.   end repeat
  105.   set the blend of sprite 4 to 100
  106.   set the blend of sprite 2 to 100
  107.   set the member of sprite 3 = member "StopStart" of castlib "SSQCST"
  108.   set the blend of sprite 3 to 100
  109.   set t = the number of member "puck" of castlib "SSQCST"
  110.   set the scriptText of member t = the scriptText of member "PuckScript"of castlib "SSQCST"   
  111.   set t = the number of member "StopStart" of castlib "SSQCST"
  112.   set the scriptText of member t = the scriptText of member "PuckStartStop" of castlib "SSQCST"
  113.   set t = the number of member "play" of castlib "SSQCST"
  114.   set the scriptText of member t = the scriptText of member "PuckStartStop"of castlib "SSQCST"
  115.   updatestage
  116.   set the movierate of sprite 48 = 1
  117. end 
  118.  
  119.  
  120.  
  121. on ControlOff
  122.   repeat with x = 2 to 5
  123.     set the blend of sprite x = 0
  124.   end repeat
  125.   set t = the number of member "puck"
  126.   set the scriptText of member t = Empty
  127.   set t = the number of member "StopStart"
  128.   set the scriptText of member t = Empty
  129.   set t = the number of member "play"
  130.   set the scriptText of member t = Empty
  131. end
  132.